﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bohdan.Arch.Messaging.Special
{
    public class ConditionalMessage : GeneralMessage
    {
        public override Guid TargetSubscriberId
        {
            get { return TimeMeasurerSubscriber._Id; }
        }

        public GeneralMessage SatisfiedMsg { get; set; }
        public GeneralMessage UnsatisfiedMsg { get; set; }
        public Func<object, bool> ConditionFuncWithArg { get; set; }
        public object Argument { get; set; }
        public ConditionalMessage(
            object argument,
            Func<object, bool> condition,
            GeneralMessage _true,
            GeneralMessage _false
            )
        {
            Argument = argument;
            ConditionFuncWithArg = condition;
            SatisfiedMsg = _true;
            UnsatisfiedMsg = _false;
        }
    }
}
